version: '3'

services:
  backend:
    container_name: backend
    build:
      context: backend
      dockerfile: Dockerfile
    networks:
      - backend
    env_file: .env
    restart: unless-stopped
    ports:
      - '4000:3000'
    depends_on:
      - postgres
  postgres:
    container_name: postgres
    image: postgres:15-alpine
    networks:
      - backend
    restart: always
    env_file: .env
    volumes:
      - pg_data:/var/lib/postgresql/data
  frontend:
    container_name: frontend
    build:
      context: frontend
      dockerfile: Dockerfile
    ports:
      - '8081:80'
    restart: unless-stopped
  adminer:
    container_name: adminer
    image: adminer
    restart: always
    ports:
      - '8080:8080'
    depends_on:
      - postgres
    networks:
      - backend
volumes:
  pg_data:
networks:
  backend: